package test.taskengine;

import com.liusy.taskengine.ReleaseTask;
import com.liusy.taskengine.listeners.AbstractCacheTaskCountListener;

public class SqlCacheTaskCountListener extends AbstractCacheTaskCountListener {

	public SqlCacheTaskCountListener(int cacheTaskCount) {
		super(cacheTaskCount);
	}


	@Override
	public void CacheTaskCountExecute(ReleaseTask releaseTask) {
		System.out.println("目前缓存中的任务不足。"+getCacheTaskCount()+"。是否需要补充......................................");
		System.out.println("添加了SqlCacheTaskCountListener100替换了"+this.getCacheTaskCount()+"的监听");
		releaseTask.addListener(ReleaseTask.CACHE_TASK_COUNT_LISTENER, new SqlCacheTaskCountListener100(100));
	}

}
